for a in range(1,100):
    for b in range(1,100):
        out = 9*a/b
        w = a+b
        d = int(w/(out/12+1))
        c = int(w-d)
        f = int(w/(out/16+1))
        e = int(w-f)

        if 12*c/d == out:
            if 16*e/f == out:
                print(a,b,c,d,e,f)

